{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch.nn as nn\n",
    "import torch.nn.functional as F\n",
    "from torch.autograd import Variable\n",
    "import torch as t"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "根据李宏毅《深度学习及其深层与结构化》第7课。深度线性网络在0点附近区域为平坦点，此时一阶为0，二阶为0。无法根据梯度决定往哪个方向移动。  \n",
    "当只有一层隐藏层时，平坦区域仅为0点，只有当init_w=0时梯度无法下降。梯度稍微偏离0一点点，就可以正常下降了。  \n",
    "当隐藏层数越来越多，平坦区域会越来越大。init_w落如此区域如同进入黑洞，无所适从。  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 没有隐藏层，init_w = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [],
   "source": [
    "class Net(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(Net, self).__init__()\n",
    "        \n",
    "        self.fc1 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc1.weight,0)\n",
    "        \n",
    "    def forward(self, x):\n",
    "        x = x.view(x.shape[0], -1)\n",
    "        x = self.fc1(x)\n",
    "        return x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [],
   "source": [
    "def fit(net, criterion, optimizer, epoches=100):\n",
    "    loss_scores = []\n",
    "    for epoch in range(epoches):  # loop over the dataset multiple times\n",
    "        x,y = 1,1\n",
    "        inputs, labels = t.Tensor([[1]]), t.Tensor([1])\n",
    "        # zero the parameter gradients\n",
    "        optimizer.zero_grad()\n",
    "        # forward + backward + optimize\n",
    "        outputs = net(inputs)\n",
    "        loss = criterion(outputs, labels)\n",
    "        loss.backward()\n",
    "        optimizer.step()\n",
    "\n",
    "        # print statistics\n",
    "        loss_scores.append(loss.item())\n",
    "    print('Finished Training')\n",
    "    return loss_scores"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Finished Training\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/windmissing/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py:431: UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.\n",
      "  return F.mse_loss(input, target, reduction=self.reduction)\n"
     ]
    }
   ],
   "source": [
    "import torch.optim as optim\n",
    "net = Net()\n",
    "criterion = nn.MSELoss()\n",
    "optimizer = optim.SGD(net.parameters(), lr = 0.01)\n",
    "loss_scores = fit(net, criterion, optimizer)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deXxV9Z3/8dcnN/tOSFiyQAKyBRSQiCiKG4ygFtDRKtVR21pHp3axnXZ02uni6K+L1rZO0ZZxr1Wr1lHGjborKEhAZN/XsCUQEhJC9u/vj3tlYghwgZuc3Hvfz8cjj3vPkns/53H0zcn3fM/3a845REQk/MV4XYCIiISGAl1EJEIo0EVEIoQCXUQkQijQRUQiRKxXX5ydne0KCwu9+noRkbC0aNGiPc65nI62eRbohYWFlJaWevX1IiJhycy2HGmbmlxERCKEAl1EJEIo0EVEIoQCXUQkQijQRUQixDED3cweNbNyM1t+hO1mZg+Y2XozW2pmp4e+TBEROZZgrtAfByYfZfsUYFDg52bgoZMvS0REjtcxA9059wFQeZRdpgFPOr/5QKaZ9Q1Vge0t2VbFr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cBKIvhcB2wFxplZcuC/98+PO6LPd8CRzu1s4PpAb5dxQPXnTTNBc86F1Q9wCbAW2AD8yOt6OukYz8H/p9ZSYEng5xL8bcpvA+sCr1le19pJx38+8Erg/QDgE2A98DyQ4HV9nXC8o4DSwPl+CegRDeca+DmwGlgO/BlIiLTzDTyD/x5BE/4r8K8f6dzib3KZGci2Zfh7AB3X9+nRfxGRCBFuTS4iInIECnQRkQihQBcRiRAKdBGRCKFAFxGJEAp0EZEIoUAXEYkQ/x+FYTpvu6sqrQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.plot(loss_scores)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1个隐藏层，init_w = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Finished Training\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/windmissing/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py:431: UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.\n",
      "  return F.mse_loss(input, target, reduction=self.reduction)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAOlElEQVR4nO3cb4xldX3H8fdHltX6LyC7JbhLXUy3rauxQkdErUJoY4C2btWmlZjw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8DxVfUAjL4ZAD+5djNbFR8B/gD44bB9HPBQVT0+bHc85y8G5oG/Hm5Z/VWS59D4XFfV/cCHge8wCvzDwG30P9cLlju3h9S4LqHPEvtaf240yXOBvwN+p6q+v9bzWU1JfhXYX1W3je9e4tBu53wdcApwRVWdDPwvjW7TLGW4J70dOAl4IfAcRrctFut2rldySH/fu4R+DjhxbHszsG+N5rLqkhzNKPJ/U1WfGXZ/d+GfcsOf+9dqfqvgtcAbk/wno9tyZzK6wj9m+Oc99Dznc8BcVX152L6OUfg7n+tfBv6jquar6gfAZ4DX0P9cL1ju3B5S47qE/lZg6/CT+fWMfniza43ntCqGe9MfA+6pqj8dG9oFnD88Px/4h8M9t9VSVe+pqs1VtYXRuf2XqnobcBPwG8NhrdYMUFX/BexN8rPDrl8C7qbxuWZ0y+a0JM8e/q4vrLn1uR6z3LndBZw3fPrmNODhhVs8E6mqFg/gHOA+4JvAe9d6Pqu4zl9k9E+2O4CvDI9zGN2z3g18Y/jzBWs911Va/xnA54fnLwb+DdgDfBp45lrPbxXW+wpgdjjfnwWO7X6ugfcBXwfuBD4BPLPjuQauYfRziB8wumJ/+3LnltGtm8uHvn2N0aeSJn4v/xcIktRcl1s3kqRlGHpJas7QS1Jzhl6SmjP0ktScoZek5gy9JDX3/zfVbv5YMXeJAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "class Net(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(Net, self).__init__()\n",
    "        \n",
    "        self.fc1 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc1.weight,0)\n",
    "        self.fc2 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc2.weight,0)\n",
    "        \n",
    "    def forward(self, x):\n",
    "        x = x.view(x.shape[0], -1)\n",
    "        x = self.fc1(x)\n",
    "        x = self.fc2(x)\n",
    "        return x\n",
    "    \n",
    "import torch.optim as optim\n",
    "net = Net()\n",
    "criterion = nn.MSELoss()\n",
    "optimizer = optim.SGD(net.parameters(), lr = 1e-1)\n",
    "loss_scores = fit(net, criterion, optimizer)\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.plot(loss_scores)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1个隐藏层，init_w极小，增大学习率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Finished Training\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/windmissing/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py:431: UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.\n",
      "  return F.mse_loss(input, target, reduction=self.reduction)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAY2UlEQVR4nO3de3Qc51nH8e8jrXZlXW1pZcu2JMtJXTdOSOOghpQCTWlpnVJsOFxqnxZayMEECOVSLgnh5EDgH1oO5ZYWDIQeQpuQBkp9gkuAND0F2qSWc3ESJ04Vx7aUxJZ8t+VY14c/duSs5ZV2tNrVzK5+n3N0tDPz7urxrPan1++8M2PujoiIlL+qqAsQEZHiUKCLiFQIBbqISIVQoIuIVAgFuohIhUhE9YPT6bR3d3dH9eNFRMrSnj17jrl7W65tkQV6d3c3vb29Uf14EZGyZGaHZtqmIRcRkQqhQBcRqRAKdBGRC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J3BXrs051kX+vpdboIe5YXUkzKyGTJh/wd3/NVh91MxWBttXAoMRlfcuYLOZHQQeIDPs8mfA0uCm3hD9vhwABtz9iWD5ITIBH5d9CPA+4BV3H3L3MeBfge8lXvtxykz7LVafITP7GPAh4CMejF0QnxqvJPPH+5ngs9MBPGlm7cSnxkuUW6CHuWH1gjMzI3Nf1Rfc/U+zNmXfPPtjZMbWF5y73+HuHe7eTWaffc3dPwI8Ruam3pHWB+DuR4B+M1sfrHovsI+Y7MPAYeBGM6sL3vOpGmOzH7PMtN92Aj8TzNK4ETg9NTSz0MxsE/A7wGZ3P5+1aSew1cxSZraWzIHHby90fe7+rLsvd/fu4LMzAFwf/K7GZj9eIupB/AIOWnyQzBHxl4E7o64nqOn7yPx3ay/wdPD1QTLj1I8C3wm+t8Sg1puAh4PHV5D5oPQBXwJSEdd2HdAb7Md/A5bFbR8CfwC8CDwH3Aekot6PwP1kxvTHyITOLTPtNzJDBfcEn59nyczYiarGPjLj0FOfmb/Oan9nUON+4Oaoapy2/SBvHhSNZD/m+9Kp/yIiFaLchlxERGQGCnQRkQqhQBcRqRAKdBGRCqFAFxGpEAp0EZEKoUAXEakQ/w8GTpLBE650LwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "class Net(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(Net, self).__init__()\n",
    "        \n",
    "        self.fc1 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc1.weight,1e-9)\n",
    "        self.fc2 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc2.weight,1e-9)\n",
    "        \n",
    "    def forward(self, x):\n",
    "        x = x.view(x.shape[0], -1)\n",
    "        x = self.fc1(x)\n",
    "        x = self.fc2(x)\n",
    "        return x\n",
    "    \n",
    "import torch.optim as optim\n",
    "net = Net()\n",
    "criterion = nn.MSELoss()\n",
    "optimizer = optim.SGD(net.parameters(), lr = 1e-1)\n",
    "loss_scores = fit(net, criterion, optimizer, epoches=150)\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.plot(loss_scores)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4个隐藏层，init_w为正态分布，方差极小"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 111,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Finished Training\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/windmissing/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py:431: UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.\n",
      "  return F.mse_loss(input, target, reduction=self.reduction)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAPhklEQVR4nO3cf5BdZ13H8feHpinDj07aZqkhiaRoVAJTaVxKC0I7qJB0sB3A0WaY6Q+ZyR+UER1Rm6ljhzIMo6Bix9oaNXYKTCtUwIDF0olF/qHYjaVp2pASfmabSpZBwtT+AZWvf9yzcLPdzd4kN7m3z7xfM3dyz/M89+z3Prvns2efc25SVUiS2vWsURcgSTqxDHpJapxBL0mNM+glqXEGvSQ1bsmoC5hr+fLltWbNmlGXIUnPKDt37vxOVU3M1zd2Qb9mzRqmpqZGXYYkPaMk+eZCfS7dSFLjDHpJapxBL0mNM+glqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4wx6SWqcQS9JjTPo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e8udHZpvmGXbS60vyHOA64E/m656nbeTf91aCfhpY3be9CjgwoloOk+RUeiH/kar6eNf87SQruv4VwMFR1Qe8Grg0yTeAO+gt33wQWJZkSTdm1PM5DUxX1Re77TvpBf+4zOOvAl+vqpmq+iHwceBVjNcc9lto3sbmOEpyJfBG4K3VrYEwPvX9DL1f6g92x80q4L+S/BTjU+NhWgn6+4G13V0OS+ldsNk+4ppIEuAfgD1V9Rd9XduBK7vnV9Jbux+JqtpSVauqag29efv3qnorcC/wG92wUdf438D+JD/fNf0K8AjjM4/fAi5I8pzuez5b39jM4RwLzdt24IruzpELgEOzSzwnU5INwB8Bl1bVk31d24HLk5yW5Bx6Fzz/82TXV1UPVdULqmpNd9xMA+u7n9OxmMOnGfVFgiFeLLmE3hX6rwLXjbqerqZfpvdn2y7gS93jEnpr4DuAr3T/njnqWrt6LwY+3T1/Mb2DaB/wMeC0Edf2cmCqm8tPAmeM0zwC7wa+DOwGPgScNg5zCNxO77rBD+kF0tsWmjd6yw43dcfQQ/TuIhpFffvorXPPHjO39I2/rqtvL7BxVHM4p/8b/ORi7Emfw0Ee/hcIktS4VpZuJEkLMOglqXEGvSQ1zqCXpMYZ9JLUOINekhpn0EtS4/4f+tQhYond0igAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "class Net(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(Net, self).__init__()\n",
    "        \n",
    "        self.fc1 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc1.weight,1e-9)\n",
    "        self.fc2 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc2.weight,1e-9)\n",
    "        self.fc3 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc3.weight,1e-9)\n",
    "        self.fc4 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc4.weight,1e-9)\n",
    "        self.fc5 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc5.weight,1e-9)\n",
    "        \n",
    "    def forward(self, x):\n",
    "        x = x.view(x.shape[0], -1)\n",
    "        x = self.fc1(x)\n",
    "        x = self.fc2(x)\n",
    "        x = self.fc3(x)\n",
    "        x = self.fc4(x)\n",
    "        x = self.fc5(x)\n",
    "        return x\n",
    "    \n",
    "import torch.optim as optim\n",
    "net = Net()\n",
    "criterion = nn.MSELoss()\n",
    "optimizer = optim.SGD(net.parameters(), lr = 1e-1)\n",
    "loss_scores = fit(net, criterion, optimizer, epoches=150)\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.plot(loss_scores)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4个隐藏层，init_w为正态分布，增大学习率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 112,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Finished Training\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/windmissing/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py:431: UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.\n",
      "  return F.mse_loss(input, target, reduction=self.reduction)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAOlElEQVR4nO3cb4xldX3H8fdHltX6LyC7JbhLXUy3rauxQkdErUJoY4C2btWmlZjwJyb7QExtU9tgbELEGNNqW0tKMLRuEW2gS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PBQVT0+bHc85y8G5oG/Hm5Z/VWS59D4XFfV/cCHge8wCvzDwG30P9cLlju3h9S4LqHPEvtaf240yXOBvwN+p6q+v9bzWU1JfhXYX1W3je9e4tBu53wdcApwRVWdDPwvjW7TLGW4J70dOAl4IfAcRrctFut2rldySH/fu4R+DjhxbHszsG+N5rLqkhzNKPJ/U1WfGXZ/d+GfcsOf+9dqfqvgtcAbk/wno9tyZzK6wj9m+Oc99Dznc8BcVX152L6OUfg7n+tfBv6jquar6gfAZ4DX0P9cL1ju3B5S47qE/lZg6/CT+fWMfniza43ntCqGe9MfA+6pqj8dG9oFnD88Px/4h8M9t9VSVe+pqs1VtYXRuf2XqnobcBPwG8NhrdYMUFX/BexN8rPDrl8C7qbxuWZ0y+a0JM8e/q4vrLn1uR6z3LndBZw3fPrmNODhhVs8E6mqFg/gHOA+4JvAe9d6Pqu4zl9k9E+2O4CvDI9zGN2z3g18Y/jzBWs911Va/xnA54fnLwb+DdgDfBp45lrPbxXW+wpgdjjfnwWO7X6ugfcBXwfuBD4BPLPjuQauYfRziB8wumJ/+3LnltGtm8uHvn2N0aeSJn4v/xcIktRcl1s3kqRlGHpJas7QS1Jzhl6SmjP0ktScoZek5gy9JDX3/zfVbv5YMXeJAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "class Net(nn.Module):\n",
    "    def __init__(self, p):\n",
    "        super(Net, self).__init__()\n",
    "        \n",
    "        self.fc1 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc1.weight,1e-9)\n",
    "        self.fc2 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc2.weight,1e-9)\n",
    "        self.fc3 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc3.weight,1e-9)\n",
    "        self.fc4 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc4.weight,1e-9)\n",
    "        self.fc5 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc5.weight,1e-9)\n",
    "        \n",
    "    def forward(self, x):\n",
    "        x = x.view(x.shape[0], -1)\n",
    "        x = self.fc1(x)\n",
    "        x = self.fc2(x)\n",
    "        x = self.fc3(x)\n",
    "        x = self.fc4(x)\n",
    "        x = self.fc5(x)\n",
    "        return x\n",
    "    \n",
    "import torch.optim as optim\n",
    "net = Net(1e-9)\n",
    "criterion = nn.MSELoss()\n",
    "optimizer = optim.SGD(net.parameters(), lr = 1e3)\n",
    "loss_scores = fit(net, criterion, optimizer, epoches=100)\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.plot(loss_scores)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 4个隐藏层，init_w为正态分布，增大学习率，增大方差"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 117,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Finished Training\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/windmissing/opt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/loss.py:431: UserWarning: Using a target size (torch.Size([1])) that is different to the input size (torch.Size([1, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.\n",
      "  return F.mse_loss(input, target, reduction=self.reduction)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEDCAYAAADJHVh5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deXxV1dX/8c9KQhLGBEKQMYQhgmESiIhjUWvFoaAtVmy1qAgdtFppfcRf26d9fJ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xM6JfGmP6szex/gOsIXS24DLiV0DH8mPm8zexZYBih25/vAn4K/Jswn21QPP9A6Gqrj4Gb3f2kHjqkoiEiIhHT4SkREYmYioaIiERMRUNERCKmoiEiIhFT0RARkYipaIiISMRUNEREJGL/H8Kotnti6gvVAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "class Net(nn.Module):\n",
    "    def __init__(self, p):\n",
    "        super(Net, self).__init__()\n",
    "        \n",
    "        self.fc1 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc1.weight,p)\n",
    "        self.fc2 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc2.weight,p)\n",
    "        self.fc3 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc3.weight,p)\n",
    "        self.fc4 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc4.weight,p)\n",
    "        self.fc5 = nn.Linear(1, 1, bias=False)\n",
    "        nn.init.constant_(self.fc5.weight,p)\n",
    "        \n",
    "    def forward(self, x):\n",
    "        x = x.view(x.shape[0], -1)\n",
    "        x = self.fc1(x)\n",
    "        x = self.fc2(x)\n",
    "        x = self.fc3(x)\n",
    "        x = self.fc4(x)\n",
    "        x = self.fc5(x)\n",
    "        return x\n",
    "    \n",
    "import torch.optim as optim\n",
    "net = Net(1e-1)\n",
    "criterion = nn.MSELoss()\n",
    "optimizer = optim.SGD(net.parameters(), lr = 1e0)\n",
    "loss_scores = fit(net, criterion, optimizer, epoches=100)\n",
    "\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.plot(loss_scores)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
